Repository navigation
BREAKING: Restrict Custom identifiers to c / cN and add OptableVID - #63
Open
jrosendahl-opt wants to merge 1 commit into
Open
jrosendahl-opt wants to merge 1 commit into
jrosendahl-opt wants to merge 1 commit into
Conversation
OptableIdentifier.Custom took any key and sent "key:value". Match the iOS
SDK, which only allows the custom types "c" and "c1".."cN":
- Custom(key: String, value) is replaced by Custom(index: Int?, value)
and Custom(value). A null or 0 index is sent as "c", any other as
"c<abs(index)>". The value is trimmed, as before.
- The Optable visitor ID, previously Custom("v", value), is now
OptableVID(value), sent as "v" with whitespace removed.
Existing Custom(key, value) calls no longer compile, so this is for 2.0.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
OptableIdentifier.Custom(key, value)sentkey:valuefor any key. The iOS SDK only allows the custom typescandc1…cN(case custom(Int? = nil, String)), with the Optable visitor ID as its ownoptableVIDcase, and that behaviour was confirmed as the correct one. This brings Android in line.What Changed
Custom(key: String, value)is replaced byCustom(index: Int?, value)andCustom(value). A null or 0 index is sent asc, any other asc<abs(index)>, matching iOS. The value is trimmed, as before.OptableIdentifier.OptableVID(value)for the Optable visitor ID, previouslyCustom("v", value). Sent asv, whitespace removed, as before.IdentifiersEncoderbuilds thec/cNprefix from the index; no other prefix can come fromCustom.Rawis unchanged.hidsexamples useOptableVID,Custom(value)andCustom(index, value).How to Test
./gradlew testpasses (161 tests locally)Custom)Notes
Do not merge before v1.3.0 is tagged, or the break ships in 1.3.0. This is for 2.0.0:
optableVersionNameingradle.propertiesneeds bumping to 2.0.0 (separately, as #52 did for 1.3.0).Migration:
Custom("v", x)→OptableVID(x);Custom("c", x)→Custom(x);Custom("cN", x)→Custom(N, x). Any other key is no longer supported; useRaw("type:value")if it is really needed.After this merges, #60's identifier table needs its
Customrow updated and anOptableVIDrow added.🤖 Generated with Claude Code